//
//  Analysis.m
//  SulitLoan
//
//  Created by 虞嘉伟 on 2025/3/2.
//

#import "Analysis.h"
#import "RiskControlRequestProvider.h"


@implementation Time

@end




@implementation Analysis
static Time *_login, *_certificate, *_IDCard, *_recognition, *_basic, *_job,
*_contact, *_repayment, *_loanStart, *_loanEnd;

+ (Time *)login {
    if (!_login) {
        _login = [Time new];
    }
    return _login;
}
+ (void)setLogin:(Time *)login {
    _login = login;
}

+ (Time *)certificate {
    if (!_certificate) {
        _certificate = [Time new];
    }
    return _certificate;
}
+ (void)setCertificate:(Time *)certificate {
    _certificate = certificate;
}

+ (Time *)IDCard {
    if (!_IDCard) {
        _IDCard = [Time new];
    }
    return _IDCard;
}
+ (void)setIDCard:(Time *)IDCard {
    _IDCard = IDCard;
}
+ (Time *)recognition {
    if (!_recognition) {
        _recognition = [Time new];
    }
    return _recognition;
}
+ (void)setRecognition:(Time *)recognition {
    _recognition = recognition;
}
+ (Time *)basic {
    if (!_basic) {
        _basic = [Time new];
    }
    return _basic;
}
+ (void)setBasic:(Time *)basic {
    _basic = basic;
}
+ (Time *)job {
    if (!_job) {
        _job = [Time new];
    }
    return _job;
}
+ (void)setJob:(Time *)job {
    _job = job;
}
+ (Time *)contact {
    if (!_contact) {
        _contact = [Time new];
    }
    return _contact;
}
+ (void)setContact:(Time *)contact {
    _contact = contact;
}
+ (Time *)repayment {
    if (!_repayment) {
        _repayment = [Time new];
    }
    return _repayment;
}
+ (void)setRepayment:(Time *)repayment {
    _repayment = repayment;
}

+ (Time *)loanStart {
    if (!_loanStart) {
        _loanStart = [Time new];
    }
    return _loanStart;
}
+ (void)setLoanStart:(Time *)loanStart {
    _loanStart = loanStart;
}
+ (Time *)loanEnd {
    if (!_loanEnd) {
        _loanEnd = [Time new];
    }
    return _loanEnd;
}
+ (void)setLoanEnd:(Time *)loanEnd {
    _loanEnd = loanEnd;
}


+ (void)sendDataWithProductID:(NSString *)productId time:(Time *)object {
    NSInteger start = object.start.timeIntervalSince1970;
    NSInteger end = object.end.timeIntervalSince1970;
    if ([object isEqual:Analysis.login]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneRegister
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.certificate]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneAuthenticationChoose
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.IDCard]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneIDCard
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.recognition]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneFace
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.basic]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneBasic
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.job]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneWork
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.contact]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneContact
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.repayment]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneBankCard
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.loanStart]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneLoanStart
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    } else if ([object isEqual:Analysis.loanEnd]) {
        [RiskControlRequestProvider requestTrackWithRiskControl:productId
                                                          scene:RiskControlTrackSceneLoanEnd
                                                          start:start
                                                            end:end
                                                        success:^(NSDictionary * _Nonnull dict) {}
                                                        failure:^(YTKRequest * _Nonnull request) {}];
    }
}

@end
